package com.cmse.persistence.dao;

import java.util.List;

import com.cmse.persistence.enmu.FetchOrderType;

/**
 * @author wulibin, exceptsky@gmail.com, 2012-3-13 下午6:34:28
 * 
 */
public interface IBaseDao<T>{
	public void add(T entity);

	public void addBatch(List<T> entityList);
	
	public boolean delete(long id);

	public List<Long> deleteBatch(long[] ids);
	
	public T get(long id);
	
	public List<T> getBatch(long ids[]);
	
	public List<T> getPage(int offset,int length, FetchOrderType orderType);
	
	public List<T> getAll(FetchOrderType orderType);
	
	public long getTotalCount();
	
	public long getCountByCondition(T expEntity);
	
	public List<T> getByCondition(T expEntity, int offset,int length, FetchOrderType orderType);
	
	public void update(T entity);
	
	public void updateBatch(List<T> entityList);
}
